/**
 * 
 */
package anything;


import java.util.Iterator;
import org.enhydra.jawe.*;
import org.enhydra.shark.xpdl.elements.Package;
import org.enhydra.shark.xpdl.elements.Transitions;
import org.enhydra.shark.xpdl.elements.WorkflowProcess;
import org.enhydra.shark.xpdl.elements.WorkflowProcesses;
/**
 * @author boy
 * 
 */
public class XPDL2SVG {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		JaWEManager.configure();
		JaWEManager mgr = JaWEManager.getInstance();
		mgr.init();
		Package pkg = mgr.getJaWEController().openPackageFromFile("G:/work/project/WADS/WADSApp/res/test/deadoralive.xml");
    pkg.setReadOnly(true);
    WorkflowProcesses wps = pkg.getWorkflowProcesses();
    Iterator<WorkflowProcess> it_wp = wps.toElements().iterator();
    while (it_wp.hasNext()) {
      Transitions ats = it_wp.next().getTransitions();
      System.out.println(ats.getTransition("2").getFrom());
    }
//		Iterator<JaWEComponent> iter = mgr.getComponentManager().getComponents().iterator();
//		while (iter.hasNext()) {
//			JaWEComponent jc = iter.next();
//			if (jc instanceof GraphController) {
//				try {
//					SaveAsJPG.saveGraphAsJPG("test.jpg", ((GraphController) jc).getSelectedGraph());
//				} catch (Exception e) {
//					System.out.println("Error: "+ e.getMessage());
//				}
//				break;
//			}
//		}
	}
}
